home *** CD-ROM | disk | FTP | other *** search
/ Acorn Collectors / Acorn Collectors CD 1.iso / acorn / ftp / riscos / releases / oslib / readme < prev   
Encoding:
Text File  |  1995-02-24  |  22.5 KB  |  603 lines

  1. Introduction
  2. ============
  3.  
  4.    OSLib is a set of functions and C headers to provide complete coverage of
  5. the RISC O S application programmer's interface in C. It provides access
  6. from C code to all RISC O S system calls ("SWI's") which is
  7.  
  8.       efficient: often, memory access is completely avoided;
  9.       type-safe: every argument can be type-checked by the compiler;
  10.       obvious: a SWI is called by the "obvious" syntax;
  11.       complete: every SWI is covered;
  12.       register-safe: hides (often idiosyncratic) register allocation;
  13.       language-independent: although the headers are specific to C, the
  14.          library is not - any A P C S-conformant language can call it.
  15.  
  16. It also provides names for all the data structures and reason codes used by
  17. the A P I. Code that uses it is superior to similar code using _kernel_swi()
  18. or _swix(), both in terms of the compile-time checking that is available,
  19. and the size and speed of the code generated.
  20.  
  21.     In addition to the module files, there is also a file "types.h" which
  22. contains macros and types useful for any programme.
  23.  
  24.    This file explains how OSLib relates to the P R M descriptions of the
  25. SWI's in complete detail. It is best read in conjunction with the header
  26. files themselves.
  27.  
  28. The OSLib Structuring Conventions
  29. === ===== =========== ===========
  30.  
  31.    Each header file provides
  32.  
  33.       function prototypes
  34.       typedefs
  35.       macros
  36.  
  37. that completely specify the interface to a module. All symbols provided by
  38. "<module>.h" are of the form <module>_<name> (except some of the form
  39. <module><name>_<reason>). For functions, <name> is the name of the SWI,
  40. converted to lower-case, and with underscores inserted between each word:
  41.  
  42.       SWI                     Function
  43.       ---                     --------
  44.       OS_ReadLine             os_read_line
  45.       Wimp_CreateWindow       wimp_create_window
  46.  
  47. For typedefs, <name> is a sequence of words in lower-case, separated by
  48. underscores:
  49.  
  50.       Type                    Meaning
  51.       ----                    -------
  52.       os_colour               a palette entry value (&bbggrr00)
  53.       wimp_window             a window definition structure
  54.  
  55. For macros, <name> is a sequence of words in upper-case, separated by
  56. underscores:
  57.  
  58.       Macro                   Meaning
  59.       -----                   -------
  60.       os_MODEVAR_XEIG_FACTOR  a value for os_read_mode_variable
  61.       error_ESCAPE            the error number of Escape (17)
  62.       wimp_ICON_NAME_LIMIT    the largest length of an icon name
  63.  
  64. (all macros for maximum values end in _LIMIT). There is also a special set
  65. of macros provided for more convenient handling of structures with a
  66. variable number of trailing parts, as used for mode selectors or Wimp
  67. window definitions, for example:
  68.  
  69.       Macro                   Meaning
  70.       -----                   -------
  71.       os_PALETTE (nc)         Declarator for a palette with |nc| colours
  72.       os_SIZEOF_PALETTE (nc)  Size of that palette
  73.       wimp_WINDOW (ni)        Declarator for a window with |ni| icons
  74.       wimp_SIZEOF_WINDOW (ni) Size of the complete window definition
  75.  
  76. Furthermore, every SWI number and SWI reason code has a macro defined of the
  77. form <Module>_<Name> (in mixed case form):
  78.  
  79.       Macro                   Value
  80.       -----                   -----
  81.       OS_WriteC               0
  82.       Font_FindFont           0x40081
  83.  
  84. These are rarely needed.
  85.  
  86.    In fact, for each SWI, two functions are provided: one has a name
  87. prefixed with an x and returns a value of type |os_error *|, which is non-
  88. null if the SWI fails; the other does not start with an x, and never returns
  89. an error: if the SWI fails, a signal (|SIGOSERROR|, number 10) is raised,
  90. and may be caught by installing a signal handler for it. The non-x form can
  91. therefore return a result, instead of having to write to an output argument:
  92. for example, the SWI Wimp_CreateWindow can be called by either of the
  93. prototypes
  94.  
  95.       os_error *xwimp_create_window (wimp_window *window, wimp_w *w);
  96.       wimp_w wimp_create_window (wimp_window *window);
  97.  
  98. They have exactly the same effect if all goes well, but if there is an
  99. error, the first just returns it, while the other raises |SIGOSERROR| and
  100. does not return at all. (If you use the second, the signal handler for
  101. |SIGOSERROR| can use _kernel_last_oserror() to find out what the error was.)
  102.  
  103.    The function prototype is derived from the SWI description in the
  104. following way. Arguments corresponding to input registers appear first in
  105. order in the argument list, followed by the addresses of variables in which
  106. the output registers' values are to be written. If an output register value
  107. is not needed, a null pointer can be written in that position. (Since |int|
  108. and all pointer types are 32 bits on the ARM, it doesn't matter which type
  109. of null pointer is used.)
  110.  
  111.    Most of the types are fully defined: e g, a |wimp_window| is a structure
  112. type with all the fields defined with the right type and name to be passed to
  113. any SWI that uses it. Some types are "abstract," however: they are exported
  114. by a module, but the internal structure is not accessible to its clients.
  115. The best way of representing this in C is by an unspecified pointer type: a
  116. definition of the form
  117.  
  118.       typedef struct <tag> *<type>
  119.  
  120. where the structure is never defined in full. Doing this allows the compiler
  121. to typecheck arguments of these types. The full list of such "abstract
  122. types" is
  123.  
  124.       buffer_b
  125.       buffer_internal_id
  126.       colourpicker_d
  127.       devicefs_d
  128.       devicefs_s
  129.       devicefs_h
  130.       dma_c
  131.       dma_tag
  132.       econet_rx_cb
  133.       econet_tx_cb
  134.       os_mode
  135.       osfscontrol_id
  136.       osspriteop_id
  137.       wimp_t
  138.       wimp_w
  139.  
  140.    In addition, various modules use values from name spaces that are
  141. centrally allocated by Acorn. These are: |error_|, |message_|, |...v|,
  142. |event_| and |upcall_|, and they each have their own prefix. They correspond
  143. to error numbers, WIMP message numbers, vectors (which are reason codes for
  144. OS_CallAVector), service calls (reason codes for OS_ServiceCall), events
  145. (reason codes for OS_GenerateEvent) and upcalls (reason codes for
  146. OS_UpCall), respectively. In cases where name clashes are possible, the
  147. module name occurs in the <name> part:
  148.  
  149.       error_BUFFER_MANAGER_BUFFER_TOO_SMALL
  150.       error_COLOUR_TRANS_BAD_DEPTH
  151.  
  152. (Vectors are represented by a suffix, |...v|, rather than a prefix, since
  153. this is familiar.) These rules mean that if you are writing code for RISC
  154. O S, and you avoid
  155.  
  156.          (a) all names that start with the name <module> of any
  157.       "<module>.h" you need to include;
  158.  
  159.          (b) all names that start with |error|, |message|, |event|
  160.       or |upcall|, or end with |v|;
  161.  
  162. then no names clashes will occur.
  163.  
  164. Types.h
  165. =======
  166.  
  167.    All OSLib header files ensure that "types.h" is included. This file
  168. contains various types, macros for value and function-like macros that are
  169. generally useful. They are described here:
  170.  
  171. Types
  172. -----
  173.  
  174.    |bits|: Used for flags values and masks, normally consisting of fields of
  175. 1 or more bits. Macros are normally provided to help with getting these
  176. fields out: for a 1-bit field, a macro |X| such that
  177.  
  178.       To                      Use
  179.       --                      ---
  180.       Read the field          (v & X) != NONE
  181.       Write a 0               v &= ~X
  182.       Write a 1               v |= X
  183.  
  184. and for a multi-bit field, macros X and X_SHIFT such that
  185.  
  186.       To                      Use
  187.       --                      ---
  188.       Read the field          (v & X) >> X_SHIFT
  189.       Write a value |w|       v = (v & ~X) | w << X_SHIFT.
  190.  
  191.    |bool|: Used for a truth value.
  192.  
  193.    |byte|: Used for a single byte value, as an alternative to |char| when the
  194. values are just data, rather than being characters as such. It is an unsigned
  195. type, which means that 2 instructions can be saved in P C C mode, where
  196. |char| is signed and must be sign-extended.
  197.  
  198. Constant-like macros
  199. ------------- ------
  200.  
  201.    |NULL|: the usual C null pointer constant.
  202.  
  203.    |FALSE|: value of type |bool| representing falsehood.
  204.  
  205.    |TRUE|: value of type |bool| representing truth.
  206.  
  207.    |NONE|: value of type |bits| with all bits clear.
  208.  
  209.    |ALL|: value of type |bits| with all bits set.
  210.  
  211.    |SKIP|: may be used as a "don't care" value for |int|, pointers,
  212. |bits|.
  213.  
  214.    |SIG_LIMIT|: largest signal number + 1.
  215.  
  216.    |_C|, |_Z|, |_N|, |_V|: masks for the flags in the P S R.
  217.  
  218.    |DEC_WIDTH|: the length of INT_MAX (2147483647) printed with %d.
  219.  
  220.    |SHORT_DEC_WIDTH|: the length of SHRT_MAX (32767) printed with %hd.
  221.  
  222.    |LONG_DEC_WIDTH|: the length of LONG_MAX (2147483647) printed with %ld.
  223.  
  224.    |OCT_WIDTH|: the length of UINT_MAX (37777777777) printed with %o.
  225.  
  226.    |SHORT_OCT_WIDTH|: the length of USHRT_MAX (177777) printed with %ho.
  227.  
  228.    |LONG_OCT_WIDTH|: the length of ULONG_MAX (37777777777) printed with %lo.
  229.  
  230.    |UNSIGNED_WIDTH|: the length of UINT_MAX (4294967295) printed with %u.
  231.  
  232.    |SHORT_UNSIGNED_WIDTH|: the length of USHRT_MAX (65535) printed with %hu.
  233.  
  234.    |LONG_UNSIGNED_WIDTH|: the length of ULONG_MAX (4294967295) printed with
  235. %lu.
  236.  
  237.    |HEX_WIDTH|: the length of UINT_MAX (FFFFFFFF) printed with %x.
  238.  
  239.    |SHORT_HEX_WIDTH|: the length of USHRT_MAX (FFFF) printed with %hx.
  240.  
  241.    |LONG_HEX_WIDTH|: the length of ULONG_MAX (FFFFFFFF) printed with %lx.
  242.  
  243.    |FLT_WIDTH|: the precision needed to distinguish 1 + FLT_EPSILON from 1
  244. printed with %f.
  245.  
  246.    |DBL_WIDTH|: the precision needed to distinguish 1 + DBL_EPSILON from 1
  247. printed with %f.
  248.  
  249.    |LDBL_WIDTH|: the precision needed to distinguish 1 + LDBL_EPSILON from 1
  250. printed with %Lf.
  251.  
  252.    |FLT_EXP_WIDTH|: the length of the exponent of FLT_MAX printed with %f.
  253.  
  254.    |DBL_EXP_WIDTH|: the length of the exponent of DBL_MAX printed with %f.
  255.  
  256.    |LDBL_EXP_WIDTH|: the length of the exponent of LDBL_MAX printed with %Lf.
  257.  
  258.    |ERROR|: intended as an "out-of-band" value to be returned by functions
  259. like fgetc() which return |EOF| on end-of-file. |ERROR| may be used to
  260. indicate an error condition.
  261.  
  262.    |UNKNOWN|: used to declare (but not define) arrays of unknown size, as
  263. an argument to the type macros (e g, wimp_WINDOW()) described above.
  264.  
  265. Function-like macros
  266. ------------- ------
  267.  
  268.    |WHETHER|: convert a bool value to a string.
  269.  
  270.    |MAX|: larger of two values.
  271.  
  272.    |MIN|: smaller of two values.
  273.  
  274.    |MAXAB|: larger of two values and assign.
  275.  
  276.    |MINAB|: smaller of two values and assign.
  277.  
  278.    |ABS|: absolute value.
  279.  
  280.    |SGN|: signum.
  281.  
  282.    |DIM|: positive difference.
  283.  
  284.    |SQR|: square.
  285.  
  286.    |RATIO|: integer division, rounding to nearer.
  287.  
  288.    |BOOL|: convert an integer to bool.
  289.  
  290.    |UCHAR|: character corresponding to a digit (upper case preferred).
  291.  
  292.    |LCHAR|: ditto, lower case.
  293.  
  294.    |BINEXP|: 2 to the power of.
  295.  
  296.    |ISDIGIT|: a digit?
  297.  
  298.    |ISXDIGIT|: a hex digit?
  299.  
  300.    |DIGIT|: if a digit, then which, else undefined.
  301.  
  302.    |XDIGIT|: if a hex digit, then which, else undefined.
  303.  
  304.    |DBLEQ|: equality for floating-point numbers (requires a tolerance)
  305.  
  306.    |BIT|: the bit at an offset from a pointer.
  307.  
  308.    |SET|: set a bit at an offset from a pointer.
  309.  
  310.    |CLR|: clear a bit at an offset from a pointer.
  311.  
  312.    |CLEAR|: clear a string.
  313.  
  314.    |EMPTY|: is a string empty?
  315.  
  316.    |NCOPY|: copy at most a given number of characters from a string, and
  317. terminate it.
  318.  
  319.    |STR_|: helper macro for STR.
  320.  
  321.    |STR|: convert a macro to source string.
  322.  
  323.    |COUNT|: number of elements in an array.
  324.  
  325.    |ALIGN|: round an integer up to the next multiple of 4.
  326.  
  327.    |WORD|: assembles an |int| from an unaligned byte pointer.
  328.  
  329.    |SHORT|: assembles a |short| from an unaligned byte pointer.
  330.  
  331. Macros that "change the language" 
  332. ------ ---- ------- --- ---------
  333.  
  334.    (Not everyone likes using these!) 
  335.  
  336.    |AS| is the same as |.|, but can be used to let the reader know that the
  337. left operand is a |union| rather than a |struct|.
  338.  
  339.    |ASREF| is the same as |->|, but can be used to let the reader know that
  340. the left operand is a |union *| rather than a |struct *|.
  341.  
  342.    |_| is the same as |,|, but if used to separate the arguments of a macro
  343. call is not recognised as a comma by the preprocessor. This lets you write
  344. macros with variable numbers of arguments.
  345.  
  346. Macros to suppress compiler warnings
  347. ------ -- -------- -------- --------
  348.  
  349.    |NOT_USED|: Suppress "variable not used" message.
  350.  
  351.    |UNSET|: Suppress "variable may be used before being set" message.
  352.  
  353. Additional Structuring Rules 
  354. ========== =========== =====
  355.  
  356.    The design aims listed in paragraph 1 are not completely compatible. In
  357. order to provide type-safety, it is necessary to provide multiple veneers
  358. for some SWI's. These fall into two classes: where a SWI has multiple reason
  359. codes, each reason code is provided with a separate function; and where a
  360. SWI has two or more different variants, each variant is provided with its
  361. own function.
  362.  
  363. Reason codes 
  364. ------ -----
  365.  
  366.    Many SWI's have several reason codes each of which has its own distinct
  367. purpose and register usage. In this case, each reason code is provided with
  368. its own function. (SWI's with a "reason code" parameter which does not
  369. affect the interpretation of the other parameters are not treated like this:
  370. instead, the reason codes are just provided as macros.) In some cases, one
  371. reason code may itself have different sub-reason codes. The complete list of
  372. SWI's divided into separate functions in this way is:
  373.  
  374.       ADFS_DiscOp
  375.       ADFS_PowerControl
  376.       ADFS_MiscOp
  377.       ColourTrans_MiscOp
  378.       DeviceFS_CallDevice
  379.       FileCore_DiscOp
  380.       FileCore_MiscOp
  381.       FilerAction_SendStartOperation
  382.       IIC_Control
  383.       NetPrint_ListServers
  384.       OS_Args*
  385.       OS_Byte*
  386.       OS_ClaimScreenMemory
  387.       OS_DynamicArea
  388.       OS_File*
  389.       OS_Find*
  390.       OS_FSControl*
  391.       OS_GBPB*
  392.       OS_Heap*
  393.       OS_Memory (RO3.5)
  394.       OS_Module*
  395.       OS_Pointer (RO3.5)
  396.       OS_ReadSysInfo*
  397.       OS_ScreenMode (RO3.5)
  398.       OS_SerialOp*
  399.       OS_SpriteOp*
  400.       OS_Word*
  401.       OSWord_ReadClock
  402.       OSWord_WriteClock
  403.       OSWord_Pointer
  404.       Parallel_Op
  405.       PDriver_MiscOp
  406.       PDriver_MiscOpForDriver
  407.       RamFS_DiscOp
  408.       ScreenModes_ReadInfo (RO3.5)
  409.       Sound_InstallVoice
  410.       TaskWindow_TaskInfo
  411.       Wimp_ClaimFreeMemory
  412.       Wimp_SpriteOp*
  413.       Wimp_ReadSysInfo*
  414.  
  415.    In every case, the functions that are derived from the SWI use the
  416. entirety of the SWI name (with no underscore) as their prefix. Those marked
  417. '*' have their own header file, with that name. Others share the header file
  418. with the SWI. Also,
  419.  
  420.       Service_International
  421.  
  422. has its own reason codes with the prefix |serviceinternational_|, residing
  423. in "serviceinternational.h";
  424.  
  425.       KeyV
  426.       PaletteV
  427.       PointerV
  428.  
  429. have reason codes in "os.h", and
  430.  
  431.       OS_UpCall 3
  432.  
  433. has reason codes with prefixes |upcallfile_|, |upcallfscontrol_| and
  434. |upcallfind_| in "osfile.h", "osfscontrol.h" and "osfind.h" respectively.
  435.  
  436.    Where a header file name is longer than 10 characters, the full name
  437. should be used in |#include| statements. FileCore-based filing systems will
  438. truncate the file name to 10 characters, if the *Configure option 'Truncate'
  439. is 'On' (which is recommended). This means that, for example, the line
  440. |#include "messagetrans.h"| will work on all filing systems: FileCore-based
  441. ones will convert the name to "messagetra.h." This applies to
  442.  
  443.       ColourTrans
  444.       DragASprite
  445.       FilerAction
  446.       MessageTrans
  447.       OSFSControl
  448.       OSReadSysInfo
  449.       ScreenBlanker
  450.       ScreenModes
  451.       ServiceInternational
  452.       SharedCLibrary
  453.       TaskManager
  454.       WimpReadSysInfo
  455.       WimpSpriteOp
  456.  
  457.    OS_WriteI might be considered to have a reason code (the character to be
  458. written), but since it is part of the SWI number, each character has a
  459. separate function. This is not worthwhile for printing characters, but for
  460. other VDU codes gives useful calls like os_clg() (to clear the graphics
  461. window), os_bell() (to ring the bell) etc. (The complete list is os_null,
  462. os_char_to_printer, os_printer_on, os_printer_off, os_split_cursors,
  463. os_join_cursors, os_vdu_on, os_bell, os_backspace, os_tab, os_line_feed,
  464. os_vertical_tab, os_cls, os_return, os_page_mode_on, os_page_mode_off,
  465. os_clg, os_set_text_colour, os_set_gcol, os_set_palette, os_reset_colours,
  466. os_vdu_off, os_set_mode, os_misc, os_set_graphics_window, os_plot_vdu,
  467. os_reset_windows, os_escape, os_set_text_window, os_set_graphics_origin,
  468. os_home_text_cursor, os_set_text_cursor, os_space, os_delete.)
  469.  
  470.    Many of the reason codes of OS_CallAVector have been omitted, namely,
  471. those where there are many sub-reason codes, and the purpose of the vector
  472. is exactly duplicated by a SWI or SWI's. So you will not find findv_-
  473. openin() (to call sub-reason code OSFind_OpenIn of reason code FindV of
  474. SWI OS_CallAVector), because it is identical in purpose to osfind_openin().
  475. If there are reason codes but no SWI, the reason codes do have functions
  476. provided (e g, PaletteV), and if there are no reason codes, the function is
  477. provided even if it does duplicate a SWI - for example, you can call
  478. os_writec() or wrchv() with the same effect (unless you are implementing
  479. them, of course). This is all just to keep the library size down. (Since
  480. calls to OS_GenerateEvent and OS_UpCall are already distributed through many
  481. files, vectored versions of them would have to be distributed in the same
  482. way.)
  483.  
  484.    Lastly, calls provided by FileSwitch are in "fileswitch.h", unless they
  485. have their own header. These are: os_bget(), bgetv(), os_bput(), bputv(),
  486. service_start_up_fs(), service_fs_redeclare(), service_close_file(). (The
  487. separate headers are "osargs.h," osfile.h," osfind.h," osfscontrol.h,"
  488. "osgbpb.h.")
  489.  
  490. Variants
  491. --------
  492.  
  493.    Some SWI's have two or more different functions that call them, because
  494. they have two different calling conventions that cannot be easily captured
  495. using C's type system. These are listed below.
  496.  
  497.    Colourtrans_select_table_for_sprite() (variant of colourtrans_select_-
  498. table()) takes an |osspriteop_area *| and an |osspriteop_id|, rather than
  499. an |os_mode| and an |os_palette *|, as its first two arguments. The same
  500. applies to colourtrans_generate_table_for_sprite() (variant of colourtrans_-
  501. generate_table()) and colourtrans_select_gcol_table_for_sprite() (variant of
  502. colourtrans_select_gcol_table()).
  503.  
  504.    Filecorediscop_floppy_read_track(), filecorediscop_hard_disc_read_id()
  505. (variants of FileCore_DiscOp 3) exist only because the purpose of this SWI
  506. is very different depending on whether the target is a hard disc or a
  507. floppy. The same variation occurs again in filing systems that provide a
  508. SWI to call this one (ADFS and RamFS).
  509.  
  510.    Filecorediscop_write_track(), filecorediscop_format_track() (variants of
  511. FileCore_DiscOp 4) also have different purposes, and need different types
  512. and numbers of arguments.
  513.  
  514.    Font_read_identifier() (variant of font_read_defn()) is provided because
  515. of the different purposes depending on the "magic number" 'FULL.'
  516.  
  517.    Font_set_true_palette() (variant of font_set_palette()) is provided
  518. because of the different purposes depending on the "magic number" 'True.'
  519.  
  520.    Event_input_buffer_full_block_op() (variant of event_input_buffer_-
  521. full()) is provided because of the different arguments, and to avoid
  522. setting bit 31 of an address in C.
  523.  
  524.    Insv_block() (variant of insv()) is provided because of different
  525. argument requirements. (Neither remv() nor cnpv() are implemented yet,
  526. however, because uniquely they have to set up P S R flags on entry.)
  527.  
  528.    Os_read_colour() (variant of os_set_colour()) is provided so that os_set_-
  529. colour() can remain backwards-compatible (RO3.5).
  530.  
  531.    Os_read_line_given_echo(), os_read_line_suppress_invalid(), os_read_-
  532. line_given_echo_suppress_invalid() are variants of os_read_line(), provided
  533. to avoid setting bits 30, 31 of an address in C, and because of the need
  534. for an extra argument for 2 of them.
  535.  
  536.    Osargs_read_ptr(), osargs_read_temporary_fs() (variants of OS_Args 0)
  537. have different argument types and different purposes.
  538.  
  539.    Osfile_load() (variant of osfile_load_stamped()) is separate because no
  540. address need be specified to load a file with a load address: the load
  541. address itself is used. This also applies to osfile_load_path() (variant of
  542. osfile_load_stamped_path()), osfile_load_path_var() (variant of osfile_-
  543. load_stamped_path_var()) and osfile_load_no_path() (variant of osfile_load_-
  544. stamped_no_path()).
  545.  
  546.    Osspriteop_read_palette_size(), osspriteop_remove_palette(),
  547. osspriteop_create_palette() and osspriteop_create_true_palette() (variants
  548. of OS_SpriteOp 37) are provided because of the separate purposes of these
  549. entries.
  550.  
  551.    Squash_compress_return_sizes() (variant of squash_compress()) and
  552. squash_decompress_return_sizes() (variant of squash_decompress()) are
  553. provided because of the different purposes dependent on bit 3 of R0.
  554.  
  555.    Territory_read_symbols() is divided into 3 variants, territory_read_-
  556. boolean_symbols(), territory_read_integer_symbols() and territory_read_-
  557. string_symbols(), because different symbols have different types.
  558.  
  559.    Wimp_create_icon_relative() and wimp_create_icon_prioritised() (variants
  560. of wimp_create_icon()) exist because of the different purposes dependent on
  561. flags in a block, involving an extra |wimp_i| input argument.
  562.  
  563.    Wimp_get_window_info_header_only() (variant of wimp_get_window_info())
  564. is there so the caller does not have to set bit 0 of an address in C.
  565.  
  566.    Wimp_report_error_by_category() (variant of wimp_report_error() needing
  567. sprite area and name and extra buttons) exists because simple use of wimp_-
  568. report_error() has fewer arguments.
  569.  
  570.    Wimp_read_true_palette() (variant of wimp_read_palette()) provides new
  571. functionality invoked by a "magic number" 'TRUE'.
  572.  
  573.    Wimp_send_message_to_window() (variant of wimp_send_message()) takes a
  574. |wimp_w| and a |wimp_i| rather than a |wimp_t|, and returns a result (the
  575. task handle) which wimp_send_message() does not.
  576.  
  577. Conclusion
  578. ==========
  579.    Although there seem to be a lot of rules, that is because the RISC O S
  580. A P I is large. For normal application programming, most of it is not
  581. needed: applications don't normally deal with vectors, upcalls or service
  582. calls, for example, or do any direct access to disc structures. However,
  583. this is not ruled out. The C headers contain the complete description of
  584. exactly what each function does in terms of the mapping of the arguments to
  585. ARM registers, so no other documentation is needed.
  586.  
  587.    OSLib provides a very convenient interface to the RISC O S programmer,
  588. since all the facilities of the C compiler are available to catch errors
  589. and generate good code. It is conceptually very small, in that it is
  590. completely documented by this file. As a bonus, code written using it is
  591. smaller and faster than code written using other means.
  592.  
  593. Disclaimer
  594. ==========
  595.  
  596.    OSLib is copyright © 1994 Acorn Computers Ltd. It is distributed in the
  597. hope that it will be useful, but without any warranty; without even the
  598. implied warranty of merchantability or fitness for a particular purpose.
  599.  
  600.    Fault reports and suggestions for improvement may be sent to the author,
  601. Jonathan Coxhead <jcoxhead@acorn.co.uk>. Although this is an Acorn address,
  602. OSLib is not an official Acorn product.
  603.